package com.huaxiafinance.management.controller;


import com.huaxiafinance.management.dto.request.QueryPOrderDto;
import com.huaxiafinance.management.service.PackageOrderService;
import com.huaxiafinance.management.util.MessageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.Valid;


/**
 * Created by hank on 2017/12/4.
 */
@Controller
@RequestMapping("/packageOrder")
public class PackageOrderController {

  private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger
      .getLogger(PackageOrderController.class);

  @Autowired
  private PackageOrderService packageOrderService;

  @RequestMapping(value = "/getPackageOrderList", produces = "application/json; charset=utf-8")
  public @ResponseBody
  String getPackageOrderList(@Valid @ModelAttribute("dto") QueryPOrderDto dto) {
    logger.info("【接收到的请求参数为】=====================" + dto);
    MessageResult result = packageOrderService.getPOrderList(dto);
    logger.info("【接收到的请求参数为】=====================" + result.getAsJSON());
    return result.getAsJSON();
  }


  @RequestMapping("/queryAllPackageByUserUuid")
  public void queryAllPackageByUserUuid(@RequestParam("userUuid") String userUuid) {

  }

}
